<template>
  <div class="app-container home">
    <div class="welcome">
      <h1>欢迎来到{{title}}</h1>
      <div class="welcome-desc">登录时间：{{loginTimeStr}}</div>
    </div>

    <div class="right-bg"></div>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "",
      loginTimeStr: "",
      title: process.env.VUE_APP_TITLE,
    };
  },
  mounted() {
    let loginTime = sessionStorage.getItem("logoTime");
    if(!loginTime)  {
      loginTime = Date.now();
      sessionStorage.setItem("logoTime", loginTime);
    }
    this.loginTimeStr = this.parseTime(loginTime, '{y}年{m}月{d}日 {h}:{i}:{s}')
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    }
  }
};
</script>

<style scoped lang="scss">
.home {
  height: calc(100vh - 84px);
  background-image: url(../assets/images/index-bg.png);
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  
  .welcome{
    height: 100%;
    padding-top: 100px;
    padding-left: 100px;
    h1 {
      font-size: 42px;
    }
    .welcome-desc {
      color: #adb9c7;
    }
  }

  .right-bg {
    position: absolute;
    top: 10%;
    right: 10%;
    width: 30%;
    height: 500px;
    background-image: url(../assets/images/index-work.png);
    background-size: 100% auto;
    background-position:center top;
    background-repeat: no-repeat;
  }
}
</style>

